﻿function ResetSearch() 
{
    document.getElementById('ctl00_ContentPlaceHolder1_searchApp_txtAppName').value = '';
    document.getElementById('ctl00_ContentPlaceHolder1_searchApp_lstAttributes').selectedIndex = -1;
    document.getElementById('ctl00_ContentPlaceHolder1_searchApp_drpThreshold').selectedIndex = 0;
    document.getElementById('ctl00$contentplaceholder1$searchApp$drpOrganization').selectedIndex = 0;
}

function Confirm(e)
{
    var answer = confirm(e);
    if (answer)
        return true;
    else 
        return false;
}

function verifyMax(control, maxlength)
{
    value=control.value;
    if(value.length>=maxlength)
    {
        event.returnValue=false;
    }
}
function verifyPaste(ctrl, maxlength, txtName)
{  
    var newVal=window.clipboardData.getData("Text");
    newValL=newVal.length;
    var curVal=ctrl.value;
    curVarL=curVal.length
    if((maxlength-curVarL)<=newValL)
    {
        ctrl.focus();
        var txtrge=document.selection.createRange();
        var ccode=String.fromCharCode(1);
        txtrge.text=ccode;
        var cursor=ctrl.value.indexOf(ccode);
        ctrl.value=curVal;
        txtrge=ctrl.createTextRange();
        txtrge.move('character', cursor);
        txtrge.select();
        txtrge.text=(window.clipboardData.getData("Text")).substring(0, maxlength-curVarL);
        event.returnValue=false;
    }
}
